<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        h1 {
            /* 禁用选中 */
            /* user-select: none; */
        }
    </style>
</head>

<body>

    <h1>8888</h1>

    <input type="text">

    <script>

        let oH1 = document.querySelector('h1');
        let oInp = document.querySelector('input');

        // copy复制 快捷键和右键都会触发此事件
        oH1.oncopy = function (e) {
            // console.log(1);
            // 不允许复制
            alert('请充值会员才能复制');
            e.preventDefault();
        }


        // paste  粘贴  快捷键和右键都会触发此事件
        oInp.onpaste = function (e) {
            e.preventDefault();
        }

    </script>

</body>

</html>